#include <iostream>
#include <cmath>
using namespace std;
int t, n;
int a[10]; 
int main(){
	cin >> t;
	while(t--){
		cin >> n;
		int len = 0, cnt = 0;
		while (n != 0){
			a[len++] = n % 10;
			if (n % 10 != 0) cnt++;
			n /= 10;
		}
		cout << cnt << endl;
		for (int i = 0; i < len; i++){
			if (a[i] != 0){
				cout << a[i] * pow(10, i) << " ";
			}
		}
		cout << endl;
		
		
	}

    return 0;
}


